You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Statistics Class > Statistics Methods > Statistics.PairwiseDistance Method
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Statistics.PairwiseDistance Method

Pairwise distance.

Syntax
C#
Visual Basic
public static void PairwiseDistance([In] TMtx X, [In] TMtx D, int p, [In] TPWDistMethod Method);

Calculates the pairwise distance for variables, stored in X.

Suppose we have collected 5 data points with 3 variables. The data matrix will look like:

X=[2,1,3, 2,3,1, 4,5,6, 6,6,6 7,5,3]

Generated distance matrix has zero diagonal and is always symmetric. To calculate Euclidian distance between each pair of points, we use the following code:

Statistics.PairWiseDistance(X,D,3); // 3 dimensions for 3 variables
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!